import Vue from 'vue'
const path = require('path')

let requireComponent = require.context('../components', false, /\.vue$/)
requireComponent.keys().forEach(fileName => {
  // console.log('fileName', fileName)
  const componentConfig = requireComponent(fileName)
  const componentName = path.basename(fileName, '.vue')
  // console.log('componentName', componentName)

  Vue.component(componentName, componentConfig.default || componentConfig)
})
